class boundbox
{
public:
vector min,max;
void reset()
{
min.vec(BIG,BIG,BIG);
max.vec(-BIG,-BIG,-BIG);
};
void add_point(vector &p);
void add_point(float x,float y,float z);
int ray_intersect(vector& ro,vector& rd,float& tnear,float& tfar);
};
Member | Type | Description |
---|---|---|
min | vector | minimum corner of bounding box |
max | vector | maximum corner of bounding box |
reset, add_point, ray_intersect
This class impements a axis aligned bounding box (AABB). The min vector specifies the minimum co-ordinates for the AABB and max the maximum co-ordinates.